<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2025/9/8
  Time: 16:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>主界面</title>
</head>
<body>
        <h1>欢迎来到华强北手机店</h1>
        <a href="addphone.jsp">添加手机</a>
        <table border="1px" width="400px">
            <tb>
                <th>库存</th>
                <th>型号</th>
                <th>库存</th>
                <th>价格</th>
                <th>上线时间</th>
                <th>功能</th>
            </tb>
            <c:forEach var="phone" items="${phone}">
                <tr>
                    <td>${phone.inventory}</td>
                    <td>${phone.name}</td>
                    <td>${phone.model}</td>
                    <td>${phone.price}</td>
                    <td>${phone.time}</td>
                    <td>
                        <a href="/findOne.do?id=${phone.id}">更新</a>
                        <a href="javascript:if (confirm('是否删除该手机?'))location.href='/removePhone.do?id=${phone.id}'">删除</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
</body>
</html>
